package com.example.glidelearningproject.fragment.drawableTypeRequest;

import com.example.glidelearningproject.GlideApp;
import com.example.glidelearningproject.fragment.start.PictureDialogFragment;
import com.example.glidelearningproject.fragment.start.RecyclerViewFragment;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.base.XPageSimpleListFragment;

import java.util.List;

@Page(name = "开始使用")
public class GlideSimpleUseFragment extends XPageSimpleListFragment {
    @Override
    protected List<String> initSimpleData(List<String> lists) {
        lists.add("定制请求");
        lists.add("在ListView和RecyclerView中使用");
        lists.add("非View目标");
        lists.add("后台线程");
        lists.add("加载Gif图片");
        return lists;
    }

    @Override
    protected void onItemClick(int position) {
        switch (position) {
            case 0:
                PictureDialogFragment pictureFragment = PictureDialogFragment.newInstance(1);
                pictureFragment.show(getActivity().getSupportFragmentManager(), "pictureDialog");
                break;
            case 1:
                openPage(RecyclerViewFragment.class);
                break;
            case 2:
                PictureDialogFragment pictureFragment1 = PictureDialogFragment.newInstance(2);
                pictureFragment1.show(getActivity().getSupportFragmentManager(), "pictureDialog1");

                break;
            case 3:
                PictureDialogFragment pictureFragment2 = PictureDialogFragment.newInstance(3);
                pictureFragment2.show(getActivity().getSupportFragmentManager(), "pictureDialog2");
                break;
            case 4:
                PictureDialogFragment pictureFragment3 = PictureDialogFragment.newInstance(4);
                pictureFragment3.show(getActivity().getSupportFragmentManager(), "pictureDialog3");
                break;
            default:
                break;
        }
    }
}
